﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zhaoxi.DesignPattern.FlyweightPattern.Abstracts;

namespace Zhaoxi.DesignPattern.FlyweightPattern.Services
{
    public class LWord : AbstractWord
    {
        /// <summary>
        /// 一个耗时耗资源的构造函数，
        /// 表明构造对象比较消耗资源
        /// </summary>
        public LWord()
        {
            long lResult = 0;
            for (int i = 0; i < 1000000; i++)
            {
                lResult += i;
            }
            Thread.Sleep(1500);
            Console.WriteLine("{0}被构造。。", this.GetType().Name);
        }
        public override string Get()
        {
            return this.GetType().Name.Replace("Word", "");
        }
    }
}
